$(document).keypress(function(e) {
   var eCode = e.keyCode ? e.keyCode : e.which ? e.which : e.charCode;
    if (eCode == 13){
    	initLogin();
    }
});
	
document.getElementsByClassName('login-btn')[0].onclick = function () {
	initLogin();
}

//登陆	
function initLogin() {
	$(".error_msg").empty().append('');	  
	var phone = document.getElementById("phone").value;
	var password = document.getElementById("password").value;	
	if(!phone){
		initErrorMsg("手机号不为空");
		return false;	
	}
	if(!password){
		initErrorMsg("密码不为空");
		return false;
	}			
	document.getElementById("logo-from").submit()
}

// 注册
/*document.getElementsByClassName('register-btn')[0].onclick = function () {
	window.location.href = "/register";	
}*/	

// 错误消息
function initErrorMsg(msg) {
	$(".error_msg").empty().append('<p class="error_msg_context">'+msg+'</p>');  
}

// 忘记密码	forget-password-btn
$(document).on('click', '.forget-password-btn', function () {
	var html = ""; 
	html += '<p class="error_msg_context">功能待开发中,请联系管理员 wx </p>';	
	html += '<img alt="" src="./../static/images/bzm-wx.jpg" style="width: 100px;margin-top: 5px;">';
	$(".error_msg").empty().append(html);	
});